package cn.dianhun.om.jpa.repository;

import cn.dianhun.om.jpa.pojo.SysMenuEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author cyt
 * @create 2020-07-08 10:50
 */
@Repository
public interface MenuRepository extends JpaRepository<SysMenuEntity, Long> {
    // 按照名字查詢
    SysMenuEntity findByName(String name);

    //按照名字和類型查詢
    SysMenuEntity findByNameAndType(String name, Integer type);

    // 名字模糊查询
    List<SysMenuEntity> findByNameLike(String name);

    List<SysMenuEntity> findAll(Specification<SysMenuEntity> specification);

    Page<SysMenuEntity> findAll(Specification<SysMenuEntity> specification, Pageable queryPage);


}
